package com.bite.demo.mapper;

import com.bite.demo.model.MessageInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MessageInfoMapper {
@Insert("insert into message_info (`from`, `to`, `message`) values " +
        "(#{from}, #{to}, #{message})")
    Integer addMessage(MessageInfo messageInfo);
@Select("select `from`, `to`, `message` from message_info ")
    List<MessageInfo> queryMessage();
}
